package router

import (
	"github.com/gin-gonic/gin"
	"kuangstudy-mall/apis/user-web/api"
	middlewares "kuangstudy-mall/apis/user-web/middleawares"
)

func InitUserRouter(RouterGroup *gin.RouterGroup) {
	userRouter := RouterGroup.Group("/user")
	{
		userRouter.GET("/list", middlewares.JWTAuth(), (&api.UserApi{}).FindUserList)
		userRouter.GET("/info/mobile", middlewares.JWTAuth(), (&api.UserApi{}).GetUserInfoByMobile)
		userRouter.GET("/info/id", middlewares.JWTAuth(), (&api.UserApi{}).GetUserInfoById)
		userRouter.GET("/info/:id", middlewares.JWTAuth(), middlewares.IsAdminAuth(), (&api.UserApi{}).GetUserInfoById2)
		userRouter.POST("/toLogin", (&api.UserApi{}).ToLogin)
		userRouter.POST("/reg", (&api.UserApi{}).Reg)
	}
}
